package com.sys.intecp;


import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class LoginInterceptor extends MethodFilterInterceptor {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected String doIntercept(ActionInvocation actionInvocation) throws Exception {
		Object user=ActionContext.getContext().getSession().get("userInfo");
		if(user!=null){
			return actionInvocation.invoke();
		}else{
			return Action.LOGIN;
		}
	}

}
